<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript" src="../js/controller/user/ROL001A.js"></script>

<s:form action="saveOrUpdateRole" method="post" >

<div id="container">
	<div id="content">
		<div class="warpper">
		
		<div class="row">
		    <div class="col-lg-12">
		        <font size="5"><i class="fa fa-edit"></i> Add/Edit Role</font>
		    </div>
		</div>
<%-- 			${role } --%>
			<div class="panel panel-default"><div class="panel-body">
			
				<table id="formTable" cellpadding="10px" cellspacing="5" border="0">
					 <tbody>
						<tr height="40px">
							<td  style="width: 15%;" align="right"><label>Role Name</label></td>
							<td style="width: 30%;"><input value="${role.roleId}" name="role.roleId"
								type="text" hidden="" /> <s:textfield name="role.roleName"
									placeholder="Enter Role Name"
									cssClass="input-default input-edit required" /><span class="required"></span></td>

							<td  style="width: 20%;" align="right"><label>User Grant</label></td>
							<td><label class="radio-inline"> <input
									type="radio" name="role.userGrant" checked  ${role.userGrant== 'RO' ? 'checked' : ''} class="ng-pristine ng-valid" value="RO">
									Read Only
							</label> <label class="radio-inline"> <input type="radio"
									name="role.userGrant" ${role.userGrant == 'RW' ? 'checked' : ''}
									class="ng-pristine ng-valid" value="RW"> Read/Write
							</label>
							 <label class="radio-inline"> <input type="radio"
									name="role.userGrant" ${role.userGrant == 'N' ? 'checked' : ''}
									class="ng-pristine ng-valid" value="N"> Not Grant
							</label>
							</td>

			</tr>
			
			<tr height="40px">
			 	<td align="right"><label>Role Description</label></td>
			 	<td><input type="text"  name="role.roleDesc" 
			 	placeholder="Enter Description" value="${role.roleDesc}"
			 	class="input-default input-edit required" /><span class="required"></span>
				</td>

			 	<td align="right"><label>Room Grant</label></td>
			 	<td>
							<label class="radio-inline"> <input type="radio" 
								name="role.roomGrant" checked  ${role.roomGrant == 'RO' ? 'checked' : ''} class="ng-pristine ng-valid" value="RO">
								Read Only
							</label> <label class="radio-inline"> <input type="radio"
								name="role.roomGrant" ${role.roomGrant == 'RW' ? 'checked' : ''}
								 class="ng-pristine ng-valid"  value="RW">
								Read/Write
							</label> 
							<label class="radio-inline"> <input type="radio"
									name="role.roomGrant" ${role.roomGrant == 'N' ? 'checked' : ''}
									class="ng-pristine ng-valid" value="N"> Not Grant
							</label>
					</td>
					 </tr>
					 
					 
					 <tr  height="40px">
					 	<td align="right"><label>Status</label></td>
					 	<td>
									<label class="radio-inline"> <input type="radio"
										name="role.active" checked	 ${role.active=='Y'? 'checked' : ''} 
										class="ng-pristine ng-valid" value="Y">
										Active
									</label> 
									<label class="radio-inline"> <input type="radio"
										name="role.active" ${role.active == 'N' ? 'checked' : ''}
										 class="ng-pristine ng-valid"  value="N">
										Inactive
									</label>
							</td>
					 	
					 	<td align="right"><label>Resident Grant</label></td>
								<td>
									<label class="radio-inline"> <input type="radio"
										name="role.residentGrant"  checked
										 ${role.residentGrant == 'RO' ? 'checked' : ''} class="ng-pristine ng-valid" value="RO">
										Read Only
									</label> <label class="radio-inline"> <input type="radio"
										name="role.residentGrant" ${role.residentGrant == 'RW' ? 'checked' : ''}
										 class="ng-pristine ng-valid"  value="RW">
										Read/Write
									</label>
									 <label class="radio-inline"> <input type="radio"
									name="role.residentGrant" ${role.residentGrant == 'N' ? 'checked' : ''}
									class="ng-pristine ng-valid" value="N"> Not Grant
							</label>
							</td>

							</tr>
				</tbody></table>
				
<!-- 			</div> -->
			
			</div>
			</div>
			
			<table>
				<tbody><tr>
					<td align="left">
						<button type="button" class="btn btn-default btn-primary" onclick="location = 'ROL001'"><i class="fa fa-hand-o-left"></i> Back</button>
					</td>
					<td align="right">
						<button id="btnSubmit" type="button" class="btn btn-default btn-primary"><i class="fa fa-save"></i> Save</button>
					</td>
				</tr>
			</tbody></table>
			
		</div>
	</div>
</div>

</s:form>
